using UnityEngine;

public class SPR_CopyPosition : MonoBehaviour
{
	[Header("-- Variables --")]
	[SerializeField]
	public Transform Target;

	[SerializeField]
	public Vector3 Offset;

	[SerializeField]
	public bool Enabled = true;

	[Header("-- Player Specific --")]
	[SerializeField]
	private bool TargetPlayer;

	private void LateUpdate()
	{
		if (Enabled)
		{
			if (!TargetPlayer && Target != null)
			{
				base.transform.position = Target.position + Offset;
			}
			else if (PlayerManager.Instance != null)
			{
				base.transform.position = PlayerManager.Instance.transform.position + Offset;
			}
		}
	}
}
